Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

302
Vistas
What is char*argv[ ] and how is it similar to char **argv

I am unable to understand how char *argv[] is similar to char **argv. Also please let me know when to use pointers?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

A function parameter declared as having array type is silently adjusted to having pointer type. Thus, if you declare a function with a parameter of type int x[], the parameter actually has type int *x. Similarly, char *argv[] in a function parameter is the same as char **argv as the array of pointers is adjusted to a pointer to pointer.

over 4 years ago · Santiago Trujillo Denunciar

0

Basically char * argv[] is array of char pointers and char ** argv is pointer to char pointer.

As we pass it as function parameter char * argv[] is adjusted to pointer-type which points to initial element of that array, char ** argv and are both the same things.

6.7.5.3 Function declarators (including prototypes) ...

7 A declaration of a parameter as ‘‘array of type’’ shall be adjusted to ‘‘qualified pointer to type’’, where the type qualifiers (if any) are those specified within the [ and ] of the array type derivation. If the keyword static also appears within the [ and ] of the array type derivation, then for each call to the function, the value of the corresponding actual argument shall provide access to the first element of an array with at least as many elements as specified by the size expression.

As you see we use both definitions of main are equivalent -

int main(int argc, char ** argv)

And

int main(int argc, char *argv[])
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda